import http from './../../../base/api/public'
import querystring from 'querystring'

let sysConfig = require('@/../config/sysConfig');
let apiUrl = sysConfig.xcApiUrlPre;

// 页面查询
// 定义方法：请求服务端的页面查询接口
export const page_list = (page, size, params) => {
  // params对象的数据拼装层k:v串
  let stringify = querystring.stringify(params);
  // 请求服务端的页面查询接口
  return http.requestQuickGet(apiUrl + '/cms/page/list/' + page + '/' + size + '?' + stringify);
};

// 新增页面
export const page_add = (params) => {
  return http.requestPost(apiUrl + '/cms/page/add', params);
};

// 根据ID查询页面
export const page_get = (id) => {
  return http.requestQuickGet(apiUrl + '/cms/page/get/' + id);
};

// 修改页面
export const page_edit = (id, params) => {
  return http.requestPut(apiUrl + '/cms/page/edit/'+ id, params);
};

// 删除页面
export const page_del = (id) => {
  return http.requestDelete(apiUrl + '/cms/page/del/'+ id);
};

// 发布页面页面
export const page_post = (id) => {
  return http.requestPost(apiUrl + '/cms/page/postPage/'+ id);
};

